package cn.foodProject.bean;

import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;

public class MyUrl implements Serializable {
    public static final String MY_URL = "http://192.168.0.104:8080";
    /**
     * 将两个字符串拼接为URL
     * @param url1 请求的地址,例如/user/login
     * @return 拼接好的URL
     */
    public static URL getUrl(String url1) {
        URL url = null;
        try {
            url = new URL(MY_URL +url1);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return url;
    }
}
